-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-71687] Intellij IDEA Inspection causes Exception during Jenkins Job fix #934
Conversation
…optional + add test
…optional + add test
…optional + add test
.setCategory(StringEscapeUtils.unescapeXml(getValue(problem))) | ||
.setMessage(StringEscapeUtils.unescapeXml(getChildValue(element, "description"))) | ||
.setModuleName(StringEscapeUtils.unescapeXml(getChildValue(element, "module"))) | ||
.setSeverity(getPriority(problem.getAttribute("severity"))); | ||
if(!getChildValue(element, "line").equals("-")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract the value into a local variable and reuse later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be much simpler when you use IntegerParser.parseInt
, then everything should work out of the box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. As recommended I change the parser to IntegerParser.
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
=========================================
Coverage 92.89% 92.89%
Complexity 2322 2322
=========================================
Files 341 341
Lines 6450 6450
Branches 669 669
=========================================
Hits 5992 5992
Misses 262 262
Partials 196 196
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing!
This pull request was created regarding following issues:
https://issues.jenkins.io/browse/JENKINS-71687
also on
https://youtrack.jetbrains.com/issue/IDEA-325906/IDEA-Inspections-cause-Exception-during-Jenkins-Job
The Idea-Inspection of the new Idea-Versions doesn't return a line-number, which causes an Error in the parseInt function (For details see Issue JENKINS-71687) ->
So I made the issueBuilder.setLineStart(Integer.parseInt(getChildValue(element, "line"))); optional.
Testing done
I added a problem to the issue56235.xml, which gets tested in the IdeaInspectionParserTest.java.
Submitter checklist